from source.dailog import Ui_Form
from PyQt5.QtWidgets import QApplication, QMainWindow, QWidget
import sys
from PyQt5 import QtCore
from PyQt5.Qt import Qt
from PyQt5.QtCore import pyqtSignal


class Dialog(QWidget, Ui_Form):
    modification_info_signal = pyqtSignal(str)

    def __init__(self):
        super(Dialog, self).__init__()
        self.setupUi(self)
        self.setFixedSize(self.width(), self.height())
        self.pushButton_2.clicked.connect(self.PushButtonClicked)
        self.pushButton_3.clicked.connect(self.exit)

    def exit(self):
        self.close()

    def PushButtonClicked(self):
        self.modification_info_signal.emit(self.lineEdit.text())
        self.close()


if __name__ == '__main__':
    QtCore.QCoreApplication.setAttribute(Qt.AA_EnableHighDpiScaling)
    app = QApplication(sys.argv)
    main = Dialog()
    main.show()
    sys.exit(app.exec_())
